home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / libraries / curses210.lha / src / winsch.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-22  |  2.2 KB  |  71 lines

  1. /* -*-C-*-
  2.  *
  3.  *
  4.  * Filename : winsch.c
  5.  *
  6.  * Author   : Simon J Raybould.    (sie@fulcrum.bt.co.uk).
  7.  *
  8.  * Date     : Friday 23rd August 1991.
  9.  *
  10.  * Desc     : Inserts a character into the screen buffer.
  11.  *            All char to the right are slid along to make room.
  12.  *
  13.  *
  14.  * THIS CODE IS NOT PUBLIC DOMAIN
  15.  * ==============================
  16.  * 
  17.  * This code is copyright Simon J Raybould 1991, all rights are reserved.
  18.  * All code, ideas, data structures and algorithms remain the property of the
  19.  * author. Neither the whole nor sections of this code may be used as part
  20.  * of other code without the authors consent. If you wish to use some of this
  21.  * code then please email me at (sie@fulcrum.bt.co.uk).
  22.  *
  23.  * This source is not public domain, so you do not have any right to alter it
  24.  * or sell it for personal gain. The source is provided purely for reference
  25.  * purposes. You may re-compile the source with any compiler you choose.
  26.  * You must not distribute altered copies without the authors consent. My
  27.  * intention is that the source will help people isolate any bugs much more
  28.  * effectivly.
  29.  *
  30.  * Disclaimer
  31.  * ==========
  32.  *
  33.  * No implication is made as to this code being fit for any purpose at all.
  34.  * I (the author) shall not be held responsible for any loss of data or damage 
  35.  * to property that may result from its use or misuse.
  36.  *
  37.  *
  38.  * Revision History
  39.  * ================
  40.  *
  41.  * $Log: winsch.c,v $
  42.  * Revision 1.2  1991/12/28  14:01:31  sie
  43.  * Removed WinStat.
  44.  * Renamed LineElement as lnel.
  45.  *
  46.  * Revision 1.1  91/09/07  11:50:31  sie
  47.  * Initial revision
  48.  * 
  49.  *
  50.  */
  51.  
  52. static char *rcsid = "$Header: /SRC/lib/curses/src/RCS/winsch.c,v 1.2 1991/12/28 14:01:31 sie Exp $";
  53.  
  54. #include "acurses.h"
  55.  
  56.  
  57. winsch(WINDOW *WinPtr, char c)
  58. {
  59.   int i;
  60.   
  61.   /* shuffle line along to the right */
  62.   for (i = WinPtr->_maxx; i > WinPtr->_curx; i--)
  63.     WinPtr->LnArry[WinPtr->_cury].Line[i] = WinPtr->LnArry[WinPtr->_cury].Line[i-1];
  64.   WinPtr->LnArry[WinPtr->_cury].Line[i] = c;
  65.   WinPtr->LnArry[WinPtr->_cury].StartCol = min(WinPtr->LnArry[WinPtr->_cury].StartCol, WinPtr->_curx);
  66.   WinPtr->LnArry[WinPtr->_cury].EndCol = WinPtr->_maxx;
  67.   WinPtr->LnArry[WinPtr->_cury].Touched = TRUE;
  68.   
  69.   return OK;
  70. }
  71.